package net.hn.hnms.biz.training.request;

import cn.hutool.core.date.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @author Wang Jingrui
 * @date 2022/8/24 14:21
 */
@Data
@ApiModel("考评结果统计图查询参数")
public class AccessmentStatisticsReq {

    @ApiModelProperty(value = "区科")
    private String department;

    @ApiModelProperty(value = "岗位工种")
    private String post;

    @ApiModelProperty(value = "柱状图类型")
    private String type;

    @ApiModelProperty(value = "煤矿编码")
    private String mineCode;

    private List<String> dateTimeRange;

    public Date getBeginDate() {
        if (dateTimeRange != null && dateTimeRange.size() > 0) {
            return DateUtil.parse(dateTimeRange.get(0),"yyyy-MM");
        }
        return null;
    }

    public Date getEndDate() {
        if (dateTimeRange != null && dateTimeRange.size() > 1) {
            return DateUtil.parse(dateTimeRange.get(1),"yyyy-MM");
        }
        return null;
    }
}
